package zjc.方法;

public class 案例打印数组内容 {
    public static void main(String[] args) {
        int[]a=new int[]{1,12,5,61};
        day(a);
    }
    public  static void day(int[] a){
        for (int i = 0; i < a.length; i++) {
            /*if(i==a.length-1){
                System.out.println(a[i]);
            }else {
                System.out.print(a[i] + ", ");
            }*/
            System.out.print(i==a.length-1?a[i]:(a[i] + ", "));
        }
    }
}
